home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Programming / SWI / source / src / pl-itf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-15  |  20.0 KB  |  587 lines

  1. /*  $Id: pl-itf.h,v 1.97 1998/04/15 15:17:05 jan Exp $
  2.  
  3.     Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  4.     See ../LICENCE to find out about your rights.
  5.     jan@swi.psy.uva.nl
  6.  
  7.     Purpose: Public declarations for defining C-predicates and embedding.
  8. */
  9.  
  10. #ifndef _FLI_H_INCLUDED
  11. #define _FLI_H_INCLUDED
  12.  
  13. #include <stdarg.h>
  14.  
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18.  
  19. /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  20. This interface has been changed considerable  between version 2.1.14 and
  21. 2.5.0. You may get most old code to work using
  22.  
  23.     #define PL_OLD_INTERFACE
  24.  
  25. before loading this file.  See end of this file.
  26. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  27.  
  28. /* PLVERSION: 10000 * <Major> + 100 * <Minor> + <Patch> */
  29.  
  30. #ifndef PLVERSION
  31. #define PLVERSION 20910
  32. #endif
  33.  
  34. /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  35. _declspec(dllexport) is used by MSVC++ 2.0 to declare exports from DLL's.
  36. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  37.  
  38. /* Get export declarations right.  Also in SWI-Stream.h, hence the
  39.    check to avoid doing it twice.
  40. */
  41.  
  42. #ifndef _PL_EXPORT_DONE
  43. #define _PL_EXPORT_DONE
  44. #ifdef WIN32
  45. #ifndef __WIN32__
  46. #define __WIN32__
  47. #endif
  48. #endif
  49.  
  50. #if defined(__WIN32__) && !defined(__LCC__)
  51. #ifdef PL_KERNEL
  52. #define __pl_export     _declspec(dllexport)
  53. #define __pl_export_data _declspec(dllexport)
  54. #define install_t     void
  55. #else
  56. #define __pl_export     extern
  57. #define __pl_export_data _declspec(dllimport)
  58. #define install_t     _declspec(dllexport) void
  59. #endif
  60. #else /*__WIN32__*/
  61. #define __pl_export     extern
  62. #define __pl_export_data extern
  63. #define install_t     void
  64. #endif /*__WIN32__*/
  65. #endif /*_PL_EXPORT_DONE*/
  66.  
  67. #ifdef _PL_INCLUDE_H
  68. typedef Module        module_t;    /* a module */
  69. typedef Procedure    predicate_t;    /* a predicate handle */
  70. #else
  71. typedef    unsigned long    atom_t;        /* Prolog atom */
  72. typedef void *        module_t;    /* Prolog module */
  73. typedef void *        predicate_t;    /* Prolog procedure */
  74. typedef unsigned long    term_t;        /* opaque term handle */
  75. typedef unsigned long    qid_t;        /* opaque query handle */
  76. typedef unsigned long    PL_fid_t;    /* opaque foreign context handle */
  77. #endif
  78. typedef unsigned long    functor_t;    /* Name/arity pair */
  79. typedef unsigned long    atomic_t;    /* same a word */
  80. typedef unsigned long    control_t;    /* non-deterministic control arg */
  81. typedef unsigned long    foreign_t;    /* return type of foreign functions */
  82. #ifdef __cplusplus
  83. typedef void *         pl_function_t;    /* can only pass function as void * */
  84. #else
  85. typedef foreign_t    (*pl_function_t)(); /* foreign language functions */
  86. #endif
  87.  
  88. #define fid_t PL_fid_t            /* avoid AIX name-clash */
  89.  
  90. #ifndef TRUE
  91. #define TRUE    (1)
  92. #define FALSE    (0)
  93. #endif
  94.  
  95.          /*******************************
  96.          *      TERM-TYPE CONSTANTS    *
  97.          *******************************/
  98.  
  99.                     /* PL_unify_term() arguments */
  100. #define    PL_VARIABLE    (1)        /* nothing */
  101. #define PL_ATOM        (2)        /* const char * */
  102. #define PL_INTEGER    (3)        /* int */
  103. #define PL_FLOAT    (4)        /* double */
  104. #define PL_STRING    (5)        /* const char * */
  105. #define PL_TERM        (6)
  106.  
  107. #define PL_FUNCTOR    (10)        /* functor_t, arg ... */
  108. #define PL_LIST        (11)        /* length, arg ... */
  109. #define PL_CHARS    (12)        /* const char * */
  110. #define PL_POINTER    (13)        /* void * */
  111.  
  112.  
  113.         /********************************
  114.         *    DETERMINISTIC CALL/RETURN  *
  115.         *********************************/
  116.  
  117. #define    PL_succeed    return TRUE    /* succeed deterministically */
  118. #define PL_fail        return FALSE    /* fail */
  119.  
  120.         /********************************
  121.         * NON-DETERMINISTIC CALL/RETURN *
  122.         *********************************/
  123.  
  124. /*  Note 1: Non-deterministic foreign functions may also use the deterministic
  125.     return methods PL_succeed and PL_fail.
  126.  
  127.     Note 2: The argument to PL_retry is a 30 bits signed integer (long).
  128. */
  129.  
  130. #define PL_FIRST_CALL        (0)
  131. #define PL_CUTTED        (1)
  132. #define PL_REDO            (2)
  133.  
  134. #define PL_retry(n)        return _PL_retry(n)
  135. #define PL_retry_address(a)    return _PL_retry_address(a)
  136.  
  137. __pl_export foreign_t        _PL_retry(long);
  138. __pl_export foreign_t        _PL_retry_address(void *);
  139. __pl_export int             PL_foreign_control(control_t);
  140. __pl_export long         PL_foreign_context(control_t);
  141. __pl_export void *         PL_foreign_context_address(control_t);
  142.  
  143.  
  144.         /********************************
  145.         *      REGISTERING FOREIGNS     *
  146.         *********************************/
  147.  
  148. typedef struct _PL_extension
  149. { char         *predicate_name;    /* Name of the predicate */
  150.   short        arity;            /* Arity of the predicate */
  151.   pl_function_t    function;        /* Implementing functions */
  152.   short        flags;            /* Or of PL_FA_... */
  153. } PL_extension;
  154.  
  155. #define PL_FA_NOTRACE        (0x01)    /* foreign cannot be traced */
  156. #define PL_FA_TRANSPARENT    (0x02)    /* foreign is module transparent */
  157. #define PL_FA_NONDETERMINISTIC    (0x04)    /* foreign is non-deterministic */
  158.  
  159. extern            PL_extension PL_extensions[]; /* not Win32! */
  160. __pl_export void    PL_register_extensions(PL_extension *e);
  161. __pl_export int        PL_register_foreign(const char *name, int arity,
  162.                         pl_function_t func, int flags);
  163.  
  164.  
  165.         /********************************
  166.         *            MODULES            *
  167.         *********************************/
  168.  
  169. __pl_export module_t    PL_context(void);
  170. __pl_export atom_t    PL_module_name(module_t module);
  171. __pl_export module_t    PL_new_module(atom_t name);
  172. __pl_export int        PL_strip_module(term_t in, module_t *m, term_t out);
  173.  
  174.  
  175.          /*******************************
  176.          *         CALL-BACK        *
  177.          *******************************/
  178.  
  179. #ifdef PL_KERNEL
  180. #define PL_Q_DEBUG        0x01    /* = TRUE for backward compatibility */
  181. #endif
  182. #define PL_Q_NORMAL        0x02    /* normal usage */
  183. #define PL_Q_NODEBUG        0x04    /* use this one */
  184. #define PL_Q_CATCH_EXCEPTION    0x08    /* handle exceptions in C */
  185. #define PL_Q_PASS_EXCEPTION    0x10    /* pass to parent environment */
  186. #ifdef PL_KERNEL
  187. #define PL_Q_DETERMINISTIC    0x20    /* call was deterministic */
  188. #endif
  189.  
  190.             /* Foreign context frames */
  191. __pl_export fid_t    PL_open_foreign_frame(void);
  192. __pl_export void    PL_close_foreign_frame(fid_t cid);
  193. __pl_export void    PL_discard_foreign_frame(fid_t cid);
  194.  
  195.             /* Finding predicates */
  196. __pl_export predicate_t    PL_pred(functor_t f, module_t m);
  197. __pl_export predicate_t    PL_predicate(const char *name, int arity,
  198.                      const char* module);
  199. __pl_export int        PL_predicate_info(predicate_t pred,
  200.                       atom_t *name, int *arity,
  201.                       module_t *module);
  202.  
  203.             /* Call-back */
  204. __pl_export qid_t    PL_open_query(module_t m, int flags,
  205.                       predicate_t pred, term_t t0);
  206. __pl_export int        PL_next_solution(qid_t qid);
  207. __pl_export void    PL_close_query(qid_t qid);
  208. __pl_export void    PL_cut_query(qid_t qid);
  209.  
  210.             /* Simplified (but less flexible) call-back */
  211. __pl_export int        PL_call(term_t t, module_t m);
  212. __pl_export int        PL_call_predicate(module_t m, int debug,
  213.                       predicate_t pred, term_t t0);
  214. __pl_export term_t    PL_exception(qid_t qid);
  215. __pl_export int        PL_throw(term_t exception);
  216.  
  217.          /*******************************
  218.          *        TERM-REFERENCES    *
  219.          *******************************/
  220.  
  221.             /* Creating and destroying term-refs */
  222. __pl_export term_t    PL_new_term_refs(int n);
  223. __pl_export term_t    PL_new_term_ref(void);
  224. __pl_export term_t    PL_copy_term_ref(term_t from);
  225. __pl_export void    PL_reset_term_refs(term_t r);
  226.  
  227.             /* Constants */
  228. __pl_export atom_t    PL_new_atom(const char *s);
  229. __pl_export const char *PL_atom_chars(atom_t a);
  230. __pl_export functor_t    PL_new_functor(atom_t f, int a);
  231. __pl_export atom_t    PL_functor_name(functor_t f);
  232. __pl_export int        PL_functor_arity(functor_t f);
  233.  
  234.             /* Get C-values from Prolog terms */
  235. __pl_export int        PL_get_atom(term_t t, atom_t *a);
  236. __pl_export int        PL_get_atom_chars(term_t t, char **a);
  237. __pl_export int        PL_get_string(term_t t, char **s, int *len);
  238. __pl_export int        PL_get_list_chars(term_t l, char **s, unsigned flags);
  239. __pl_export int        PL_get_chars(term_t t, char **s, unsigned flags);
  240. __pl_export int        PL_get_integer(term_t t, int *i);
  241. __pl_export int        PL_get_long(term_t t, long *i);
  242. __pl_export int        PL_get_pointer(term_t t, void **ptr);
  243. __pl_export int        PL_get_float(term_t t, double *f);
  244. __pl_export int        PL_get_functor(term_t t, functor_t *f);
  245. __pl_export int        PL_get_name_arity(term_t t, atom_t *name, int *arity);
  246. __pl_export int        PL_get_module(term_t t, module_t *module);
  247. __pl_export int        PL_get_arg(int index, term_t t, term_t a);
  248. __pl_export int        PL_get_list(term_t l, term_t h, term_t t);
  249. __pl_export int        PL_get_head(term_t l, term_t h);
  250. __pl_export int        PL_get_tail(term_t l, term_t t);
  251. __pl_export int        PL_get_nil(term_t l);
  252.  
  253.             /* Verify types */
  254. __pl_export int        PL_term_type(term_t t);
  255. __pl_export int        PL_is_variable(term_t t);
  256. __pl_export int        PL_is_atom(term_t t);
  257. __pl_export int        PL_is_integer(term_t t);
  258. __pl_export int        PL_is_string(term_t t);
  259. __pl_export int        PL_is_float(term_t t);
  260. __pl_export int        PL_is_compound(term_t t);
  261. __pl_export int        PL_is_functor(term_t t, functor_t f);
  262. __pl_export int        PL_is_list(term_t t);
  263. __pl_export int        PL_is_atomic(term_t t);
  264. __pl_export int        PL_is_number(term_t t);
  265.  
  266.             /* Assign to term-references */
  267. __pl_export void    PL_put_variable(term_t t);
  268. __pl_export void    PL_put_atom(term_t t, atom_t a);
  269. __pl_export void    PL_put_atom_chars(term_t t, const char *chars);
  270. __pl_export void    PL_put_string_chars(term_t t, const char *chars);
  271. __pl_export void    PL_put_list_chars(term_t t, const char *chars);
  272. __pl_export void    PL_put_integer(term_t t, long i);
  273. __pl_export void    PL_put_pointer(term_t t, void *ptr);
  274. __pl_export void    PL_put_float(term_t t, double f);
  275. __pl_export void    PL_put_functor(term_t t, functor_t functor);
  276. __pl_export void    PL_put_list(term_t l);
  277. __pl_export void    PL_put_nil(term_t l);
  278. __pl_export void    PL_put_term(term_t t1, term_t t2);
  279.  
  280.             /* construct a functor or list-cell */
  281. __pl_export void    PL_cons_functor(term_t h, functor_t f, ...);
  282. __pl_export void    PL_cons_list(term_t l, term_t h, term_t t);
  283.  
  284.             /* Unify term-references */
  285. __pl_export int        PL_unify(term_t t1, term_t t2);
  286. __pl_export int        PL_unify_atom(term_t t, atom_t a);
  287. __pl_export int        PL_unify_atom_chars(term_t t, const char *chars);
  288. __pl_export int        PL_unify_list_chars(term_t t, const char *chars);
  289. __pl_export int        PL_unify_string_chars(term_t t, const char *chars);
  290. __pl_export int        PL_unify_string_nchars(term_t t,
  291.                            int len, const char *chars);
  292. __pl_export int        PL_unify_integer(term_t t, long n);
  293. __pl_export int        PL_unify_float(term_t t, double f);
  294. __pl_export int        PL_unify_pointer(term_t t, void *ptr);
  295. __pl_export int        PL_unify_functor(term_t t, functor_t f);
  296. __pl_export int        PL_unify_list(term_t l, term_t h, term_t t);
  297. __pl_export int        PL_unify_nil(term_t l);
  298. __pl_export int        PL_unify_arg(int index, term_t t, term_t a);
  299. __pl_export int        PL_unify_term(term_t t, ...);
  300.  
  301.          /*******************************
  302.          *      FILENAME SUPPORT    *
  303.          *******************************/
  304.  
  305. __pl_export char *    PL_get_filename(term_t n, char *buf, unsigned int sz);
  306.  
  307.  
  308.          /*******************************
  309.          *   QUINTUS WRAPPER SUPPORT    *
  310.          *******************************/
  311.  
  312. __pl_export int        PL_cvt_i_integer(term_t p, long *c);
  313. __pl_export int        PL_cvt_i_float(term_t p, double *c);
  314. __pl_export int        PL_cvt_i_single(term_t p, float *c);
  315. __pl_export int        PL_cvt_i_string(term_t p, char **c);
  316. __pl_export int        PL_cvt_i_atom(term_t p, atom_t *c);
  317. __pl_export int        PL_cvt_o_integer(long c, term_t p);
  318. __pl_export int        PL_cvt_o_float(double c, term_t p);
  319. __pl_export int        PL_cvt_o_single(float c, term_t p);
  320. __pl_export int        PL_cvt_o_string(const char *c, term_t p);
  321. __pl_export int        PL_cvt_o_atom(atom_t c, term_t p);
  322.  
  323.  
  324.          /*******************************
  325.          *         COMPARE        *
  326.          *******************************/
  327.  
  328. __pl_export int        PL_compare(term_t t1, term_t t2);
  329.  
  330.          /*******************************
  331.          *         MESSAGES        *
  332.          *******************************/
  333.  
  334. __pl_export int        PL_warning(const char *fmt, ...);
  335. __pl_export void    PL_fatal_error(const char *fmt, ...);
  336.  
  337.          /*******************************
  338.          *          FEATURES        *
  339.          *******************************/
  340.  
  341. __pl_export int        PL_set_feature(const char *name, int type, ...);
  342.  
  343.          /*******************************
  344.          *    INTERNAL FUNCTIONS    *
  345.          *******************************/
  346.  
  347. __pl_export atomic_t    _PL_get_atomic(term_t t);
  348. __pl_export void    _PL_put_atomic(term_t t, atomic_t a);
  349. __pl_export int        _PL_unify_atomic(term_t t, atomic_t a);
  350. __pl_export void    _PL_copy_atomic(term_t t, atomic_t a);
  351.         int        _PL_get_name_arity(term_t t, atom_t *name, int *arity);
  352.         void    _PL_get_arg(int index, term_t t, term_t a);
  353.  
  354.  
  355.          /*******************************
  356.          *        CHAR BUFFERS    *
  357.          *******************************/
  358.  
  359. #define CVT_ATOM    0x0001
  360. #define CVT_STRING    0x0002
  361. #define CVT_LIST    0x0004
  362. #define CVT_INTEGER    0x0008
  363. #define CVT_FLOAT    0x0010
  364. #define CVT_VARIABLE    0x0020
  365. #define CVT_NUMBER    (CVT_INTEGER|CVT_FLOAT)
  366. #define CVT_ATOMIC    (CVT_NUMBER|CVT_ATOM|CVT_STRING)
  367. #define CVT_ALL        0x00ff
  368.  
  369. #define BUF_DISCARDABLE    0x0000
  370. #define BUF_RING    0x0100
  371. #define BUF_MALLOC    0x0200
  372.  
  373. #ifdef SIO_MAGIC            /* defined from <SWI-Stream.h> */
  374.          /*******************************
  375.          *      STREAM SUPPORT    *
  376.          *******************************/
  377.  
  378.                     /* Make IOSTREAM known to Prolog */
  379. __pl_export int PL_open_stream(term_t t, IOSTREAM *s);
  380. #endif
  381.  
  382.  
  383.          /*******************************
  384.          *        EMBEDDING        *
  385.          *******************************/
  386.  
  387. __pl_export int        PL_initialise(int argc, char **argv);
  388. install_t        PL_install_readline(void);
  389. __pl_export int        PL_toplevel(void);
  390. __pl_export void    PL_halt(int status);
  391.  
  392.          /*******************************
  393.          *      INPUT/PROMPT/ETC    *
  394.          *******************************/
  395.  
  396. /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  397. NOTE: the functions in this section are   not  documented, as as yet not
  398. adviced for public usage.  They  are   intended  to  provide an abstract
  399. interface for the GNU readline  interface   as  defined in pl-rl.c. This
  400. abstract interface is necessary to make an embeddable system without the
  401. readline overhead.
  402. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  403.                     /* PL_dispatch() modes */
  404. #define PL_DISPATCH_NOWAIT    0        /* Dispatch only once */
  405. #define PL_DISPATCH_WAIT      1        /* Dispatch till input available */
  406. #define PL_DISPATCH_INSTALLED 2        /* dispatch function installed? */
  407.  
  408.                     /* PL_ttymode() results */
  409. #define PL_NOTTY    0        /* -tty in effect */
  410. #define PL_RAWTTY    1        /* get_single_char/1 */
  411. #define PL_COOKEDTTY    2        /* normal input */
  412.  
  413. __pl_export int        PL_dispatch(int fd, int wait);
  414. __pl_export int        PL_ttymode(int fd);
  415. __pl_export void    PL_add_to_protocol(const char *buf, int count);
  416. __pl_export char *    PL_prompt_string(int fd);
  417. __pl_export void    PL_write_prompt(int fd, int dowrite);
  418. __pl_export void    PL_prompt_next(int fd);
  419. __pl_export char *    PL_atom_generator(char *prefix, int state);
  420. __pl_export void    PL_clock_wait_ticks(long waited);
  421.  
  422.  
  423.         /********************************
  424.         *             HOOKS        *
  425.         ********************************/
  426.  
  427. #define PL_DISPATCH_INPUT   0        /* There is input available */
  428. #define PL_DISPATCH_TIMEOUT 1        /* Dispatch timeout */
  429.  
  430. typedef int  (*PL_dispatch_hook_t)(int fd);
  431. typedef void (*PL_abort_hook_t)(void);
  432. typedef void (*PL_initialise_hook_t)(int argc, char **argv);
  433. typedef void (*PL_async_hook_t)(void);    /* Win32 only (O_ASYNC_HOOK) */
  434. typedef int  (*PL_getkey_hook_t)(int fd);
  435.  
  436. __pl_export PL_dispatch_hook_t PL_dispatch_hook(PL_dispatch_hook_t);
  437. __pl_export void           PL_abort_hook(PL_abort_hook_t);
  438. __pl_export void           PL_initialise_hook(PL_initialise_hook_t);
  439. __pl_export int               PL_abort_unhook(PL_abort_hook_t);
  440. __pl_export PL_async_hook_t    PL_async_hook(unsigned int, PL_async_hook_t);
  441. __pl_export PL_getkey_hook_t   PL_getkey_hook(PL_getkey_hook_t);
  442.  
  443.  
  444.         /********************************
  445.         *            SIGNALS            *
  446.         *********************************/
  447.  
  448. __pl_export void (*PL_signal(int sig, void (*func)(int)))(int);
  449. __pl_export void PL_interrupt(int sig);
  450. __pl_export void PL_raise(int sig);
  451. __pl_export void PL_handle_signals(void);
  452.  
  453.         /********************************
  454.         *      PROLOG ACTION/QUERY      *
  455.         *********************************/
  456.  
  457. #define    PL_ACTION_TRACE        1    /* switch to trace mode */
  458. #define PL_ACTION_DEBUG        2    /* switch to debug mode */
  459. #define PL_ACTION_BACKTRACE    3    /* show a backtrace (stack dump) */
  460. #define PL_ACTION_BREAK        4    /* create a break environment */
  461. #define PL_ACTION_HALT        5    /* halt Prolog execution */
  462. #define PL_ACTION_ABORT        6    /* generate a Prolog abort */
  463. #define PL_ACTION_SYMBOLFILE    7    /* make arg. the symbol file */
  464. #define PL_ACTION_WRITE        8    /* write via Prolog i/o buffer */
  465. #define PL_ACTION_FLUSH        9    /* Flush Prolog i/o buffer */
  466.  
  467. __pl_export int     PL_action(int, ...);    /* perform some action */
  468. __pl_export void PL_on_halt(void (*)(int, void *), void *);
  469.  
  470.         /********************************
  471.         *         QUERY PROLOG          *
  472.         *********************************/
  473.  
  474. #define PL_QUERY_ARGC        1    /* return main() argc */
  475. #define PL_QUERY_ARGV        2    /* return main() argv */
  476. #define PL_QUERY_SYMBOLFILE    3    /* return current symbol file */
  477. #define PL_QUERY_ORGSYMBOLFILE    4    /* symbol file before first load */
  478. #define PL_QUERY_GETC        5    /* Read character from terminal */
  479. #define PL_QUERY_MAX_INTEGER    6    /* largest integer */
  480. #define PL_QUERY_MIN_INTEGER    7    /* smallest integer */
  481. #define PL_QUERY_MAX_TAGGED_INT    8    /* largest tagged integer */
  482. #define PL_QUERY_MIN_TAGGED_INT    9    /* smallest tagged integer */
  483. #define PL_QUERY_VERSION       10    /* 207006 = 2.7.6 */
  484.  
  485. __pl_export long    PL_query(int);    /* get information from Prolog */
  486.  
  487.          /*******************************
  488.          *       FAST XPCE SUPPORT    *
  489.          *******************************/
  490.  
  491. typedef struct
  492. { int type;                /* PL_INTEGER or PL_ATOM */
  493.   union
  494.   { unsigned long i;            /* integer reference value */
  495.     atom_t      a;            /* atom reference value */
  496.   } value;
  497. } xpceref_t;
  498.  
  499. __pl_export int        _PL_get_xpce_reference(term_t t, xpceref_t *ref);
  500. __pl_export int        _PL_unify_xpce_reference(term_t t, xpceref_t *ref);
  501. __pl_export void    _PL_put_xpce_reference_i(term_t t, unsigned long r);
  502. __pl_export void    _PL_put_xpce_reference_a(term_t t, atom_t name);
  503.  
  504.          /*******************************
  505.          *        COMPATIBILITY        *
  506.          *******************************/
  507.  
  508. #ifdef PL_OLD_INTERFACE
  509.  
  510. typedef term_t term;
  511. typedef atomic_t atomic;
  512.  
  513. #ifndef _PL_INCLUDE_H
  514.                     /* renamed functions */
  515. #define PL_is_var(t)        PL_is_variable(t)
  516. #define PL_is_int(t)        PL_is_integer(t)
  517. #define PL_is_term(t)        PL_is_compound(t)
  518. #define PL_type(t)        PL_term_type(t)
  519. #define PL_atom_value(a)    (char *)PL_atom_chars((atom_t)(a))
  520. #define PL_predicate(f, m)    PL_pred(f, m)
  521.  
  522.                     /* force undefined symbols */
  523.                     /* if PL_OLD_INTERFACE isn't set */
  524. #define PL_strip_module(t, m)    _PL_strip_module(t, m)
  525. #define PL_atomic(t)        _PL_atomic(t)
  526. #define PL_float_value(t)    _PL_float_value(t)
  527. #define PL_integer_value(t)    _PL_integer_value(t)
  528. #define PL_string_value(t)    _PL_string_value(t)
  529. #define PL_functor(t)        _PL_functor(t)
  530. #define PL_arg(t, n)        _PL_arg(t, n)
  531. #define PL_new_term()        _PL_new_term()
  532. #define PL_new_integer(i)    _PL_new_integer(i)
  533. #define PL_new_float(f)        _PL_new_float(f)
  534. #define PL_new_string(s)    _PL_new_string(s)
  535. #define PL_new_var()        _PL_new_var()
  536. #define PL_term(a)        _PL_term(a)
  537. #define PL_unify_atomic(t, a)    _PL_unify_atomic(t, (atomic_t) (a))
  538.  
  539. typedef fid_t            bktrk_buf;
  540. #define PL_mark(b)        (*(b) = PL_open_foreign_frame())
  541. #define PL_bktrk(b)        PL_discard_foreign_frame(*(b))
  542. #endif /*_PL_INCLUDE_H*/
  543.  
  544.          /*******************************
  545.          *         ANALYSIS        *
  546.          *******************************/
  547.  
  548. __pl_export atomic_t    _PL_atomic(term_t t);
  549. __pl_export long    _PL_integer_value(atomic_t t);
  550. __pl_export double    _PL_float_value(atomic_t t);
  551. __pl_export char *    _PL_string_value(atomic_t t);
  552. __pl_export char *    _PL_list_string_value(term_t t);
  553. __pl_export functor_t    _PL_functor(term_t t);
  554. __pl_export term_t    _PL_arg(term_t t, int n);
  555.  
  556.  
  557.          /*******************************
  558.          *         CONSTRUCT        *
  559.          *******************************/
  560.  
  561. __pl_export term_t    _PL_new_term(void);
  562. __pl_export atomic_t    _PL_new_integer(long i);
  563. __pl_export atomic_t    _PL_new_float(double f);
  564. __pl_export atomic_t    _PL_new_string(const char *s);
  565. __pl_export atomic_t    _PL_new_var(void);
  566. __pl_export term_t    _PL_term(atomic_t a);
  567.  
  568.          /*******************************
  569.          *           UNIFY        *
  570.          *******************************/
  571.  
  572. __pl_export int        _PL_unify_atomic(term_t t, atomic_t a);
  573.  
  574.          /*******************************
  575.          *           MODULES        *
  576.          *******************************/
  577.  
  578. __pl_export term_t    _PL_strip_module(term_t t, module_t *m);
  579.  
  580. #endif /*PL_OLD_INTERFACE*/
  581.  
  582. #ifdef __cplusplus
  583. }
  584. #endif
  585.  
  586. #endif /*_FLI_H_INCLUDED*/
  587.